﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteWithControlAccess.Master"
    Inherits="ProjetoComperio.SystemFramework.Web.ComperioViewPage<ProjetoComperio.DataLayer.Entities.Event>" %>

<%@ Import Namespace="MvcContrib" %>
<%@ Import Namespace="MvcContrib.UI.Grid" %>
<%@ Import Namespace="MvcContrib.UI.Grid.ActionSyntax" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="ComperioFramework.Web.Security.UrlEncrypt" %>
<%@ Import Namespace="ProjetoComperio.Framework.Web.Security.UrlEncrypt" %>
<%@ Import Namespace="ProjetoComperio.DataLayer.Entities" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <style type="text/css">
        /* TABLE
        /* TABLE
----------------------------------------------------------*/table
        {
            border: solid 1px #e8eef4;
            border-collapse: collapse;
        }
        table td
        {
            padding: 5px;
            border: solid 1px #e8eef4;
        }
        table th
        {
            padding: 6px 5px;
            text-align: left;
            background-color: #e8eef4;
            border: solid 1px #e8eef4;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Eventos
    </h2>
    <%= Html.Grid(ViewData["GridSource"] as IQueryable<Event>).Columns(
           column => 
           {  
            column.For(x => x.Title).Named("Título");
            column.For(x => x.StartDate).Named("Data de Início");
            column.For(x => x.EndDate).Named("Data de Término");
            column.For(x => Html.ActionLink("Ver", "Visualize", new { id = URLEncrypt.EncryptToString(x.ContributionID.ToString()) })
               ).DoNotEncode().Attributes(x => new Hash(style => "font-weight:bold"));
           }).Attributes(Style =>  "width:100%").Empty("Não existem eventos cadastrados.")
           
    %>
    <br />
    <br />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
</asp:Content>
